<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>默认主题配置 | VuePress</title>
    <meta name="description" content="Vue 驱动的静态网站生成器">
    <link rel="icon" href="/vuepress-theme-purple/logo.png">
  <link rel="manifest" href="/vuepress-theme-purple/manifest.json">
  <meta name="theme-color" content="#3eaf7c">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <link rel="apple-touch-icon" href="/vuepress-theme-purple/icons/apple-touch-icon-152x152.png">
  <link rel="mask-icon" href="/vuepress-theme-purple/icons/safari-pinned-tab.svg" color="#3eaf7c">
  <meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
  <meta name="msapplication-TileColor" content="#000000">
    
    <link rel="preload" href="/vuepress-theme-purple/assets/css/0.styles.4750dc60.css" as="style"><link rel="preload" href="/vuepress-theme-purple/assets/js/app.a1c2f8fd.js" as="script"><link rel="preload" href="/vuepress-theme-purple/assets/js/5.ceb67ac2.js" as="script"><link rel="preload" href="/vuepress-theme-purple/assets/js/4.0adfbd1a.js" as="script"><link rel="preload" href="/vuepress-theme-purple/assets/js/97.506fd3ae.js" as="script"><link rel="preload" href="/vuepress-theme-purple/assets/js/7.18012d7b.js" as="script"><link rel="preload" href="/vuepress-theme-purple/assets/js/6.14f6ca82.js" as="script"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/10.a5a6ea3e.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/100.ec2ceaa9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/101.6dfa1a45.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/102.11915ae0.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/11.2ec43fbc.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/12.e5cec480.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/13.30b10f5f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/14.9d9396ac.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/15.8e9556f8.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/16.2ce11086.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/17.7bbf8455.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/18.1d45c66b.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/19.0ff815f1.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/20.a19a1201.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/21.0367ba8f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/22.0b9a8718.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/23.78c12ede.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/24.19cd8818.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/25.5eaa46dc.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/26.f38b21a1.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/27.0785a519.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/28.d23df74d.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/29.2f2dd6ca.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/30.a1bed37f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/31.7a5b7b61.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/32.2a38681f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/33.29933d35.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/34.df24a0ef.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/35.23d86e21.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/36.3c551b3f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/37.832cb8d4.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/38.47f6c955.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/39.6f51d483.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/40.b69df168.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/41.0f0c7aa2.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/42.7b1d48b5.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/43.2c5e9b01.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/44.b339774e.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/45.6206eef7.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/46.119a0a86.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/47.eb84c6c2.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/48.c31f8327.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/49.3e055789.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/50.6c78c9fc.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/51.343c71a0.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/52.76de97d9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/53.a377d1ca.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/54.8b342bc9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/55.465812e1.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/56.98edd7cd.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/57.eeca3305.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/58.a58b8904.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/59.f6d4b102.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/60.92072575.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/61.2777f097.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/62.f4effeca.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/63.658ff6dc.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/64.0987e73f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/65.36b268a4.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/66.60412057.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/67.5b563239.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/68.5ecac304.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/69.37c6e078.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/70.f7a710e9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/71.24bb765b.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/72.f770f72d.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/73.28783a42.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/74.67fcabaf.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/75.785ce193.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/76.48a6ef71.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/77.a8133ac0.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/78.b950bccd.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/79.846d11a1.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/8.b4abe17a.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/80.e746a20b.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/81.9ad3a7b4.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/82.7daf65f4.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/83.d506c84b.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/84.86d70e47.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/85.45ae9504.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/86.5ecfb585.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/87.a75e695f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/88.39411bf5.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/89.a18a78c1.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/9.c4d21b85.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/90.45813435.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/91.a9b7f9e9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/92.3f789f66.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/93.3420f93e.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/94.eac427a9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/95.2b3fcbfb.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/96.263a20f3.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/98.4d8c9524.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/99.ee01147c.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/vendors~flowchart.9a3d1af6.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/vendors~notification.1cc30b22.js">
    <link rel="stylesheet" href="/vuepress-theme-purple/assets/css/0.styles.4750dc60.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="navbar-container"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/vuepress-theme-purple/zh/" class="home-link router-link-active"><!----> <span class="site-name">VuePress</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/vuepress-theme-purple/zh/guide/" class="nav-link">指南</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/config/" class="nav-link">配置</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/plugin/" class="nav-link">插件</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/theme/" class="nav-link router-link-active">主题</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>API</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/api/cli.html" class="nav-link">CLI</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/api/node.html" class="nav-link">Node</a></li></ul></li><li class="dropdown-item"><h4>开发指南</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/local-development.html" class="nav-link">本地开发</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/design-concepts.html" class="nav-link">设计理念</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/faq/" class="nav-link">FAQ</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/glossary.html" class="nav-link">术语</a></li></ul></li><li class="dropdown-item"><h4>其他</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/migration-guide.html" class="nav-link">从 0.x 迁移</a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Changelog
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://v0.vuepress.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  0.x
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="选择语言" class="dropdown-title"><span class="title">选择语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/vuepress-theme-purple/theme/default-theme-config.html" class="nav-link">English</a></li><li class="dropdown-item"><!----> <a href="/vuepress-theme-purple/zh/theme/default-theme-config.html" class="nav-link router-link-exact-active router-link-active">简体中文</a></li></ul></div></div> <a href="https://github.com/fengxinming/vuepress-theme-purple" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></div></header> <div class="page-container"><div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/vuepress-theme-purple/zh/guide/" class="nav-link">指南</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/config/" class="nav-link">配置</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/plugin/" class="nav-link">插件</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/theme/" class="nav-link router-link-active">主题</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>API</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/api/cli.html" class="nav-link">CLI</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/api/node.html" class="nav-link">Node</a></li></ul></li><li class="dropdown-item"><h4>开发指南</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/local-development.html" class="nav-link">本地开发</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/design-concepts.html" class="nav-link">设计理念</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/faq/" class="nav-link">FAQ</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/glossary.html" class="nav-link">术语</a></li></ul></li><li class="dropdown-item"><h4>其他</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/migration-guide.html" class="nav-link">从 0.x 迁移</a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Changelog
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://v0.vuepress.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  0.x
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="选择语言" class="dropdown-title"><span class="title">选择语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/vuepress-theme-purple/theme/default-theme-config.html" class="nav-link">English</a></li><li class="dropdown-item"><!----> <a href="/vuepress-theme-purple/zh/theme/default-theme-config.html" class="nav-link router-link-exact-active router-link-active">简体中文</a></li></ul></div></div> <a href="https://github.com/fengxinming/vuepress-theme-purple" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>主题</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vuepress-theme-purple/zh/theme/" class="sidebar-link">介绍</a></li><li><a href="/vuepress-theme-purple/zh/theme/using-a-theme.html" class="sidebar-link">使用主题</a></li><li><a href="/vuepress-theme-purple/zh/theme/writing-a-theme.html" class="sidebar-link">开发主题</a></li><li><a href="/vuepress-theme-purple/zh/theme/option-api.html" class="sidebar-link">主题的配置</a></li><li><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html" class="active sidebar-link">默认主题配置</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#首页" class="sidebar-link">首页</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#导航栏" class="sidebar-link">导航栏</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#导航栏-logo" class="sidebar-link">导航栏 Logo</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#导航栏链接" class="sidebar-link">导航栏链接</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#禁用导航栏" class="sidebar-link">禁用导航栏</a></li></ul></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#侧边栏" class="sidebar-link">侧边栏</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#嵌套的标题链接" class="sidebar-link">嵌套的标题链接</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#显示所有页面的标题链接" class="sidebar-link">显示所有页面的标题链接</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#活动的标题链接" class="sidebar-link">活动的标题链接</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#侧边栏分组" class="sidebar-link">侧边栏分组</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#多个侧边栏" class="sidebar-link">多个侧边栏</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#自动生成侧栏" class="sidebar-link">自动生成侧栏</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#禁用侧边栏" class="sidebar-link">禁用侧边栏</a></li></ul></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#搜索框" class="sidebar-link">搜索框</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#内置搜索" class="sidebar-link">内置搜索</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#algolia-搜索" class="sidebar-link">Algolia 搜索</a></li></ul></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#最后更新时间" class="sidebar-link">最后更新时间</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#上-下一篇链接" class="sidebar-link">上 / 下一篇链接</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#git-仓库和编辑链接" class="sidebar-link">Git 仓库和编辑链接</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#页面滚动" class="sidebar-link">页面滚动</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#自定义页面类" class="sidebar-link">自定义页面类</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#特定页面的自定义布局" class="sidebar-link">特定页面的自定义布局</a></li></ul></li><li><a href="/vuepress-theme-purple/zh/theme/inheritance.html" class="sidebar-link">主题的继承</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="默认主题配置"><a href="#默认主题配置" class="header-anchor">#</a> 默认主题配置</h1> <div class="custom-block tip"><p class="custom-block-title">提示</p> <p>本页所列的选项仅对默认主题生效。如果你在使用一个自定义主题，选项可能会有不同。</p></div> <h2 id="首页"><a href="#首页" class="header-anchor">#</a> 首页</h2> <p>默认的主题提供了一个首页（Homepage）的布局 (用于 <a href="/vuepress-theme-purple/zh/" class="router-link-active">这个网站的主页</a>)。想要使用它，需要在你的根级 <code>README.md</code> 的 <a href="/vuepress-theme-purple/zh/guide/markdown.html#front-matter">YAML front matter</a> 指定 <code>home: true</code>。以下是一个如何使用的例子：</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">home</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">heroImage</span><span class="token punctuation">:</span> /hero.png
<span class="token key atrule">heroText</span><span class="token punctuation">:</span> Hero 标题
<span class="token key atrule">tagline</span><span class="token punctuation">:</span> Hero 副标题
<span class="token key atrule">actionText</span><span class="token punctuation">:</span> 快速上手 →
<span class="token key atrule">actionLink</span><span class="token punctuation">:</span> /zh/guide/
<span class="token key atrule">features</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">title</span><span class="token punctuation">:</span> 简洁至上
  <span class="token key atrule">details</span><span class="token punctuation">:</span> 以 Markdown 为中心的项目结构，以最少的配置帮助你专注于写作。
<span class="token punctuation">-</span> <span class="token key atrule">title</span><span class="token punctuation">:</span> Vue驱动
  <span class="token key atrule">details</span><span class="token punctuation">:</span> 享受 Vue + webpack 的开发体验，在 Markdown 中使用 Vue 组件，同时可以使用 Vue 来开发自定义主题。
<span class="token punctuation">-</span> <span class="token key atrule">title</span><span class="token punctuation">:</span> 高性能
  <span class="token key atrule">details</span><span class="token punctuation">:</span> VuePress 为每个页面预渲染生成静态的 HTML，同时在页面被加载的时候，将作为 SPA 运行。
<span class="token key atrule">footer</span><span class="token punctuation">:</span> MIT Licensed <span class="token punctuation">|</span> Copyright © 2018<span class="token punctuation">-</span>present Evan You
<span class="token punctuation">---</span>
</code></pre></div><p>你可以将相应的内容设置为 <code>null</code> 来禁用标题和副标题。</p> <p>任何 <code>YAML front matter</code> 之后额外的内容将会以普通的 markdown 被渲染，并插入到 <code>features</code> 的后面。</p> <h2 id="导航栏"><a href="#导航栏" class="header-anchor">#</a> 导航栏</h2> <p>导航栏可能包含你的页面标题、<a href="#%E6%90%9C%E7%B4%A2%E6%A1%86">搜索框</a>、 <a href="#%E5%AF%BC%E8%88%AA%E6%A0%8F%E9%93%BE%E6%8E%A5">导航栏链接</a>、<a href="/vuepress-theme-purple/zh/guide/i18n.html">多语言切换</a>、<a href="#git-%E4%BB%93%E5%BA%93%E5%92%8C%E7%BC%96%E8%BE%91%E9%93%BE%E6%8E%A5">仓库链接</a>，它们均取决于你的配置。</p> <h3 id="导航栏-logo"><a href="#导航栏-logo" class="header-anchor">#</a> 导航栏 Logo</h3> <p>你可以通过 <code>themeConfig.logo</code> 增加导航栏 Logo ，Logo 可以被放置在<a href="/vuepress-theme-purple/zh/guide/assets.html#public-files">公共文件目录</a>：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    logo<span class="token operator">:</span> <span class="token string">'/assets/img/logo.png'</span><span class="token punctuation">,</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h3 id="导航栏链接"><a href="#导航栏链接" class="header-anchor">#</a> 导航栏链接</h3> <p>你可以通过 <code>themeConfig.nav</code> 增加一些导航栏链接:</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    nav<span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span> text<span class="token operator">:</span> <span class="token string">'Home'</span><span class="token punctuation">,</span> link<span class="token operator">:</span> <span class="token string">'/'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> text<span class="token operator">:</span> <span class="token string">'Guide'</span><span class="token punctuation">,</span> link<span class="token operator">:</span> <span class="token string">'/guide/'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> text<span class="token operator">:</span> <span class="token string">'External'</span><span class="token punctuation">,</span> link<span class="token operator">:</span> <span class="token string">'https://google.com'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>


</code></pre></div><p>外部链接 <code>&lt;a&gt;</code> 标签的特性将默认包含<code>target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;</code>，你可以提供 <code>target</code> 与 <code>rel</code>，它们将被作为特性被增加到 <code>&lt;a&gt;</code> 标签上：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    nav<span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span> text<span class="token operator">:</span> <span class="token string">'External'</span><span class="token punctuation">,</span> link<span class="token operator">:</span> <span class="token string">'https://google.com'</span><span class="token punctuation">,</span> target<span class="token operator">:</span><span class="token string">'_self'</span><span class="token punctuation">,</span> rel<span class="token operator">:</span><span class="token string">''</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> text<span class="token operator">:</span> <span class="token string">'Guide'</span><span class="token punctuation">,</span> link<span class="token operator">:</span> <span class="token string">'/guide/'</span><span class="token punctuation">,</span> target<span class="token operator">:</span><span class="token string">'_blank'</span> <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>当你提供了一个 <code>items</code> 数组而不是一个单一的 <code>link</code> 时，它将显示为一个 <code>下拉列表</code> ：</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    nav<span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span>
        text<span class="token operator">:</span> <span class="token string">'Languages'</span><span class="token punctuation">,</span>
        ariaLabel<span class="token operator">:</span> <span class="token string">'Language Menu'</span><span class="token punctuation">,</span>
        items<span class="token operator">:</span> <span class="token punctuation">[</span>
          <span class="token punctuation">{</span> text<span class="token operator">:</span> <span class="token string">'Chinese'</span><span class="token punctuation">,</span> link<span class="token operator">:</span> <span class="token string">'/language/chinese/'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span> text<span class="token operator">:</span> <span class="token string">'Japanese'</span><span class="token punctuation">,</span> link<span class="token operator">:</span> <span class="token string">'/language/japanese/'</span> <span class="token punctuation">}</span>
        <span class="token punctuation">]</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>此外，你还可以通过嵌套的 <code>items</code> 来在 <code>下拉列表</code> 中设置分组：</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    nav<span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span>
        text<span class="token operator">:</span> <span class="token string">'Languages'</span><span class="token punctuation">,</span>
        items<span class="token operator">:</span> <span class="token punctuation">[</span>
          <span class="token punctuation">{</span> text<span class="token operator">:</span> <span class="token string">'Group1'</span><span class="token punctuation">,</span> items<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token comment">/*  */</span><span class="token punctuation">]</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span> text<span class="token operator">:</span> <span class="token string">'Group2'</span><span class="token punctuation">,</span> items<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token comment">/*  */</span><span class="token punctuation">]</span> <span class="token punctuation">}</span>
        <span class="token punctuation">]</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h3 id="禁用导航栏"><a href="#禁用导航栏" class="header-anchor">#</a> 禁用导航栏</h3> <p>你可以使用 <code>themeConfig.navbar</code> 来禁用所有页面的导航栏：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    navbar<span class="token operator">:</span> <span class="token boolean">false</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>你也可以通过 <code>YAML front matter</code> 来禁用某个指定页面的导航栏：</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">navbar</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token punctuation">---</span>
</code></pre></div><h2 id="侧边栏"><a href="#侧边栏" class="header-anchor">#</a> 侧边栏</h2> <p>想要使 侧边栏（Sidebar）生效，需要配置 <code>themeConfig.sidebar</code>，基本的配置，需要一个包含了多个链接的数组：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    sidebar<span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token string">'/'</span><span class="token punctuation">,</span>
      <span class="token string">'/page-a'</span><span class="token punctuation">,</span>
      <span class="token punctuation">[</span><span class="token string">'/page-b'</span><span class="token punctuation">,</span> <span class="token string">'Explicit link text'</span><span class="token punctuation">]</span>
    <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>你可以省略 <code>.md</code> 拓展名，同时以 <code>/</code> 结尾的路径将会被视为 <code>*/README.md</code>，这个链接的文字将会被自动获取到（无论你是声明为页面的第一个 header，还是明确地在 <code>YAML front matter</code> 中指定页面的标题）。如果你想要显示地指定链接的文字，使用一个格式为 <code>[link, text]</code> 的数组。</p> <h3 id="嵌套的标题链接"><a href="#嵌套的标题链接" class="header-anchor">#</a> 嵌套的标题链接</h3> <p>默认情况下，侧边栏会自动地显示由当前页面的标题（headers）组成的链接，并按照页面本身的结构进行嵌套，你可以通过 <code>themeConfig.sidebarDepth</code> 来修改它的行为。默认的深度是 <code>1</code>，它将提取到 <code>h2</code> 的标题，设置成 <code>0</code> 将会禁用标题（headers）链接，同时，最大的深度为 <code>2</code>，它将同时提取 <code>h2</code> 和 <code>h3</code> 标题。</p> <p>也可以使用 <code>YAML front matter</code> 来为某个页面重写此值：</p> <div class="language-md extra-class"><pre class="language-md"><code><span class="token hr punctuation">---</span>
<span class="token title important">sidebarDepth: 2
<span class="token punctuation">---</span></span>
</code></pre></div><h3 id="显示所有页面的标题链接"><a href="#显示所有页面的标题链接" class="header-anchor">#</a> 显示所有页面的标题链接</h3> <p>默认情况下，侧边栏只会显示由当前活动页面的标题（headers）组成的链接，你可以将 <code>themeConfig.displayAllHeaders</code> 设置为 <code>true</code> 来显示所有页面的标题链接：</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    displayAllHeaders<span class="token operator">:</span> <span class="token boolean">true</span> <span class="token comment">// 默认值：false</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h3 id="活动的标题链接"><a href="#活动的标题链接" class="header-anchor">#</a> 活动的标题链接</h3> <p>默认情况下，当用户通过滚动查看页面的不同部分时，嵌套的标题链接和 URL 中的 Hash 值会实时更新，这个行为可以通过以下的配置来禁用：</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    activeHeaderLinks<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 默认值：true</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><div class="custom-block tip"><p class="custom-block-title">提示</p> <p>值得一提的是，当你禁用此选项时，此功能的相应脚本将不会被加载，这是我们性能优化的一个小点。</p></div> <h3 id="侧边栏分组"><a href="#侧边栏分组" class="header-anchor">#</a> 侧边栏分组</h3> <p>你可以通过使用<strong>对象</strong>来将侧边栏划分成多个组：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    sidebar<span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span>
        title<span class="token operator">:</span> <span class="token string">'Group 1'</span><span class="token punctuation">,</span>   <span class="token comment">// 必要的</span>
        path<span class="token operator">:</span> <span class="token string">'/foo/'</span><span class="token punctuation">,</span>      <span class="token comment">// 可选的, 应该是一个绝对路径</span>
        collapsable<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 可选的, 默认值是 true,</span>
        sidebarDepth<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>    <span class="token comment">// 可选的, 默认值是 1</span>
        children<span class="token operator">:</span> <span class="token punctuation">[</span>
          <span class="token string">'/'</span>
        <span class="token punctuation">]</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span>
        title<span class="token operator">:</span> <span class="token string">'Group 2'</span><span class="token punctuation">,</span>
        children<span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token comment">/* ... */</span> <span class="token punctuation">]</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>侧边栏的每个子组默认是可折叠的，你可以设置 <code>collapsable: false</code> 来让一个组永远都是展开状态。</p> <p>一个侧边栏的子组配置同时支持 <a href="#nested-header-links">sidebarDepth</a> 字段用于重写默认显示的侧边栏深度(<code>1</code>)。</p> <div class="custom-block tip"><p class="custom-block-title">提示</p> <p>嵌套的侧边栏分组 <span class="badge tip" style="vertical-align:top;" data-v-c13ee5b0>beta</span> 也是支持的，但嵌套深度应小于 3，否则在控制台会收到警告。</p></div> <h3 id="多个侧边栏"><a href="#多个侧边栏" class="header-anchor">#</a> 多个侧边栏</h3> <p>如果你想为不同的页面组来显示不同的侧边栏，首先，将你的页面文件组织成下述的目录结构：</p> <div class="language- extra-class"><pre class="language-text"><code>.
├─ README.md
├─ contact.md
├─ about.md
├─ foo/
│  ├─ README.md
│  ├─ one.md
│  └─ two.md
└─ bar/
   ├─ README.md
   ├─ three.md
   └─ four.md
</code></pre></div><p>接着，遵循以下的侧边栏配置：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    sidebar<span class="token operator">:</span> <span class="token punctuation">{</span>
      <span class="token string">'/foo/'</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token string">''</span><span class="token punctuation">,</span>     <span class="token comment">/* /foo/ */</span>
        <span class="token string">'one'</span><span class="token punctuation">,</span>  <span class="token comment">/* /foo/one.html */</span>
        <span class="token string">'two'</span>   <span class="token comment">/* /foo/two.html */</span>
      <span class="token punctuation">]</span><span class="token punctuation">,</span>

      <span class="token string">'/bar/'</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token string">''</span><span class="token punctuation">,</span>      <span class="token comment">/* /bar/ */</span>
        <span class="token string">'three'</span><span class="token punctuation">,</span> <span class="token comment">/* /bar/three.html */</span>
        <span class="token string">'four'</span>   <span class="token comment">/* /bar/four.html */</span>
      <span class="token punctuation">]</span><span class="token punctuation">,</span>

      <span class="token comment">// fallback</span>
      <span class="token string">'/'</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token string">''</span><span class="token punctuation">,</span>        <span class="token comment">/* / */</span>
        <span class="token string">'contact'</span><span class="token punctuation">,</span> <span class="token comment">/* /contact.html */</span>
        <span class="token string">'about'</span>    <span class="token comment">/* /about.html */</span>
      <span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><div class="custom-block warning"><p class="custom-block-title">注意</p> <p>确保 fallback 侧边栏被最后定义。VuePress 会按顺序遍历侧边栏配置来寻找匹配的配置。</p></div> <h3 id="自动生成侧栏"><a href="#自动生成侧栏" class="header-anchor">#</a> 自动生成侧栏</h3> <p>如果你希望自动生成一个仅仅包含了当前页面标题（headers）链接的侧边栏，你可以通过 <code>YAML front matter</code> 来实现：</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">sidebar</span><span class="token punctuation">:</span> auto
<span class="token punctuation">---</span>
</code></pre></div><p>你也可以通过配置来在所有页面中启用它：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    sidebar<span class="token operator">:</span> <span class="token string">'auto'</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>在 <a href="/vuepress-theme-purple/zh/guide/i18n.html">多语言</a> 模式下, 你也可以将其应用到某一特定的语言下：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
     <span class="token string">'/zh/'</span><span class="token operator">:</span> <span class="token punctuation">{</span>
       sidebar<span class="token operator">:</span> <span class="token string">'auto'</span>
     <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h3 id="禁用侧边栏"><a href="#禁用侧边栏" class="header-anchor">#</a> 禁用侧边栏</h3> <p>你可以通过 <code>YAML front matter</code> 来禁用指定页面的侧边栏：</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">sidebar</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token punctuation">---</span>
</code></pre></div><h2 id="搜索框"><a href="#搜索框" class="header-anchor">#</a> 搜索框</h2> <h3 id="内置搜索"><a href="#内置搜索" class="header-anchor">#</a> 内置搜索</h3> <p>你可以通过设置 <code>themeConfig.search: false</code> 来禁用默认的搜索框，或是通过 <code>themeConfig.searchMaxSuggestions</code> 来调整默认搜索框显示的搜索结果数量：</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    search<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    searchMaxSuggestions<span class="token operator">:</span> <span class="token number">10</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>你可以通过 <code>YAML front matter</code> 来对单独的页面禁用内置的搜索框：</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">search</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token punctuation">---</span>
</code></pre></div><div class="custom-block tip"><p class="custom-block-title">提示</p> <p>内置搜索只会为页面的标题、<code>h2</code> 和 <code>h3</code> 构建搜索索引，如果你需要全文搜索，你可以使用 <a href="#Algolia-%E6%90%9C%E7%B4%A2">Algolia 搜索</a>。</p></div> <h3 id="algolia-搜索"><a href="#algolia-搜索" class="header-anchor">#</a> Algolia 搜索</h3> <p>你可以通过 <code>themeConfig.algolia</code> 选项来用 <a href="https://community.algolia.com/docsearch/" target="_blank" rel="noopener noreferrer">Algolia 搜索<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 替换内置的搜索框。要启用 Algolia 搜索，你需要至少提供 <code>apiKey</code> 和 <code>indexName</code>：</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    algolia<span class="token operator">:</span> <span class="token punctuation">{</span>
      apiKey<span class="token operator">:</span> <span class="token string">'&lt;API_KEY&gt;'</span><span class="token punctuation">,</span>
      indexName<span class="token operator">:</span> <span class="token string">'&lt;INDEX_NAME&gt;'</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><div class="custom-block warning"><p class="custom-block-title">注意</p> <p>不同于开箱即用的 <a href="#%E5%86%85%E7%BD%AE%E6%90%9C%E7%B4%A2">内置搜索</a>，<a href="https://community.algolia.com/docsearch/" target="_blank" rel="noopener noreferrer">Algolia 搜索<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 需要你在使用之前将你的网站提交给它们用于创建索引。</p></div> <p>更多选项请参考 <a href="https://github.com/algolia/docsearch#docsearch-options" target="_blank" rel="noopener noreferrer">Algolia DocSearch 的文档<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>。</p> <h2 id="最后更新时间"><a href="#最后更新时间" class="header-anchor">#</a> 最后更新时间</h2> <p>你可以通过 <code>themeConfig.lastUpdated</code> 选项来获取每个文件最后一次 <code>git</code> 提交的 UNIX 时间戳(ms)，同时它将以合适的日期格式显示在每一页的底部：</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    lastUpdated<span class="token operator">:</span> <span class="token string">'Last Updated'</span><span class="token punctuation">,</span> <span class="token comment">// string | boolean</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>请注意，<code>themeConfig.lastUpdated</code> 默认是关闭的，如果给定一个字符串，它将会作为前缀显示（默认值是：<code>Last Updated</code>）。</p> <div class="custom-block warning"><p class="custom-block-title">使用须知</p> <p>由于 <code>lastUpdated</code> 是基于 <code>git</code> 的, 所以你只能在一个基于 <code>git</code> 的项目中启用它。此外，由于使用的时间戳来自 git commit，因此它将仅在给定页的第一次提交之后显示，并且仅在该页面后续提交更改时更新。</p></div> <p><strong>拓展阅读:</strong></p> <ul><li><a href="/vuepress-theme-purple/zh/plugin/official/plugin-last-updated.html">@vuepress/plugin-last-updated</a></li></ul> <h2 id="上-下一篇链接"><a href="#上-下一篇链接" class="header-anchor">#</a> 上 / 下一篇链接</h2> <p>上一篇和下一篇文章的链接将会自动地根据当前页面的侧边栏的顺序来获取。</p> <p>你可以通过 <code>themeConfig.nextLinks</code> 和 <code>themeConfig.prevLinks</code> 来全局禁用它们：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    <span class="token comment">// 默认值是 true 。设置为 false 来禁用所有页面的 下一篇 链接</span>
    nextLinks<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token comment">// 默认值是 true 。设置为 false 来禁用所有页面的 上一篇 链接</span>
    prevLinks<span class="token operator">:</span> <span class="token boolean">false</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>你也可以使用 <code>YAML front matter</code> 来明确地重写或者禁用它们：</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">prev</span><span class="token punctuation">:</span> ./some<span class="token punctuation">-</span>other<span class="token punctuation">-</span>page
<span class="token key atrule">next</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token punctuation">---</span>
</code></pre></div><h2 id="git-仓库和编辑链接"><a href="#git-仓库和编辑链接" class="header-anchor">#</a> Git 仓库和编辑链接</h2> <p>当你提供了 <code>themeConfig.repo</code> 选项，将会自动在每个页面的导航栏生成生成一个 GitHub 链接，以及在页面的底部生成一个 <code>&quot;Edit this page&quot;</code> 链接。</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    <span class="token comment">// 假定是 GitHub. 同时也可以是一个完整的 GitLab URL</span>
    repo<span class="token operator">:</span> <span class="token string">'vuejs/vuepress'</span><span class="token punctuation">,</span>
    <span class="token comment">// 自定义仓库链接文字。默认从 `themeConfig.repo` 中自动推断为</span>
    <span class="token comment">// &quot;GitHub&quot;/&quot;GitLab&quot;/&quot;Bitbucket&quot; 其中之一，或是 &quot;Source&quot;。</span>
    repoLabel<span class="token operator">:</span> <span class="token string">'查看源码'</span><span class="token punctuation">,</span>

    <span class="token comment">// 以下为可选的编辑链接选项</span>

    <span class="token comment">// 假如你的文档仓库和项目本身不在一个仓库：</span>
    docsRepo<span class="token operator">:</span> <span class="token string">'vuejs/vuepress'</span><span class="token punctuation">,</span>
    <span class="token comment">// 假如文档不是放在仓库的根目录下：</span>
    docsDir<span class="token operator">:</span> <span class="token string">'docs'</span><span class="token punctuation">,</span>
    <span class="token comment">// 假如文档放在一个特定的分支下：</span>
    docsBranch<span class="token operator">:</span> <span class="token string">'master'</span><span class="token punctuation">,</span>
    <span class="token comment">// 默认是 false, 设置为 true 来启用</span>
    editLinks<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token comment">// 默认为 &quot;Edit this page&quot;</span>
    editLinkText<span class="token operator">:</span> <span class="token string">'帮助我们改善此页面！'</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>你可以通过 <code>YAML front matter</code> 来禁用指定页面的编辑链接：</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">editLink</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token punctuation">---</span>
</code></pre></div><h2 id="页面滚动"><a href="#页面滚动" class="header-anchor">#</a> 页面滚动 <span class="badge tip" style="vertical-align:top;" data-v-c13ee5b0>1.2.0+</span></h2> <p>你可以通过 <code>themeConfig.smoothScroll</code> 选项来启用页面滚动效果。</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// .vuepress/config.js</span>
module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  themeConfig<span class="token operator">:</span> <span class="token punctuation">{</span>
    smoothScroll<span class="token operator">:</span> <span class="token boolean">true</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="自定义页面类"><a href="#自定义页面类" class="header-anchor">#</a> 自定义页面类</h2> <p>有时候你可能需要为特定页面添加一个 CSS 类名，以方便针对该页面添加一些专门的 CSS。这种情况下你可以在该页面的 YAML front matter 中声明一个 <code>pageClass</code>：</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">pageClass</span><span class="token punctuation">:</span> custom<span class="token punctuation">-</span>page<span class="token punctuation">-</span>class
<span class="token punctuation">---</span>
</code></pre></div><p>然后你就可以写专门针对该页面的 CSS 了：</p> <div class="language-css extra-class"><pre class="language-css"><code><span class="token comment">/* .vuepress/override.styl */</span>

<span class="token selector">.theme-container.custom-page-class</span> <span class="token punctuation">{</span>
  <span class="token comment">/* 特定页面的 CSS */</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="特定页面的自定义布局"><a href="#特定页面的自定义布局" class="header-anchor">#</a> 特定页面的自定义布局</h2> <p>默认情况下，每个 <code>*.md</code> 文件将会被渲染在一个 <code>&lt;div class=&quot;page&quot;&gt;</code> 容器中，同时还有侧边栏、自动生成的编辑链接，以及上 / 下一篇文章的链接。如果你想要使用一个完全自定义的组件来代替当前的页面（而只保留导航栏），你可以再次使用 <code>YAML front matter</code> 来指定这个组件。</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">layout</span><span class="token punctuation">:</span> SpecialLayout
<span class="token punctuation">---</span>
</code></pre></div><p>这将会为当前的页面渲染 <code>.vuepress/components/SpecialLayout.vue</code> 布局。</p></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/fengxinming/vuepress-theme-purple/edit/master/zh/theme/default-theme-config.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2020-1-13 1:59:37</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/vuepress-theme-purple/zh/theme/option-api.html" class="prev">主题的配置</a></span> <span class="next"><a href="/vuepress-theme-purple/zh/theme/inheritance.html">主题的继承</a>
      →
    </span></p></div> </main></div></div><div class="global-ui"><!----><!----></div></div>
    <script src="/vuepress-theme-purple/assets/js/app.a1c2f8fd.js" defer></script><script src="/vuepress-theme-purple/assets/js/5.ceb67ac2.js" defer></script><script src="/vuepress-theme-purple/assets/js/4.0adfbd1a.js" defer></script><script src="/vuepress-theme-purple/assets/js/97.506fd3ae.js" defer></script><script src="/vuepress-theme-purple/assets/js/7.18012d7b.js" defer></script><script src="/vuepress-theme-purple/assets/js/6.14f6ca82.js" defer></script>
  </body>
</html>
